const Router = require('koa-router');
const {db, Op,QueryTypes } = require("../../models/db");
const router = new Router();
// 换算购物车saveSale
router.post('/app/saveUser', async ctx => {
    let usr = ctx.user
    let tenantId = usr.tenantId
    let formData = ctx.request.body.formData
    let model = await db.models['admin'].findOne({
        where: {
            id: usr.id,
            tenantId
        }
    })
    if(model) {
        model.name = formData.name
        model.mobile = formData.mobile
        model.sign = formData.sign
        await model.save()
    }


    return ctx.suc('保存成功')
})

module.exports = router;
